package com.example.yzj66.newdialer;

import android.support.v7.app.AppCompatActivity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

public class NewDialer extends AppCompatActivity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_new_dialer);

        Button dialer=(Button)findViewById(R.id.Button01);
        dialer.setOnClickListener( new View.OnClickListener(){
            public void onClick(View v){
                //Intent <Intent_name>=new Intent (<Action>,<Data>);
                Intent intent=new Intent(Intent.ACTION_DIAL,Uri.parse("tel://114"));
                startActivity(intent);
            }
        });
    }
}
